package com.cdeledu.thread4.c19;

import java.util.concurrent.TimeUnit;

public class Test {

	public static void main(String[] args) throws InterruptedException {
		FutureService<String, Integer> service = FutureService.newService();
		service.submit(input -> {
			try {
				TimeUnit.SECONDS.sleep(3);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			return input.length();
		}, "Hello", System.out::println);
	}

}
